/*
 * $Id: Vofce.java,v 1.5 2003/05/17 15:37:50 znamenacek Exp $
 *
 * Copyright (c) Tomas Znamenacek
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 *
 */

package net.sf.vofce.gui;

import net.sf.vofce.project.Project;

import java.util.ResourceBundle;

/**
 * This class just creates an instance of the main window.
 */
public class Vofce {

	/** Localised resource strings. */
	protected static ResourceBundle resources;

	/** Instance of the project. */
	protected static Project project = Project.getInstance();

	/** Opens the main window. */
	public static void main(String[] args) {

		processArgs(args);
		MainWindow vofce = new MainWindow();
	}

	/** Processes command line arguments. */
	protected static void processArgs(String[] args) {

		for (int i = 0; i < args.length; i++) {

			if (args[i].equals("--version")) {

				System.out.println(resources.getString("misc.versionbanner"));
				System.exit(0);
			}
			
			if (args[i].equals("--help")) {

				System.out.println(resources.getString("misc.arghelp"));
				System.exit(0);
			}

			if (args[i].startsWith("--")) {

				System.err.println(resources.getString("misc.unknownarg") + ": " + args[i]);
				System.exit(1);
			}

			// TODO: load project args[i]
		}
	}
}
